

import java.util.Scanner; 


public class TestCircle {
//this is a test for the class Circle;
	public static void main(String[] args){
	System.out.println("please, input coordinates (integers) of the center of our circle in format: x y");
	//reading coordinates:
	Scanner workString = new Scanner(System.in);
	String our_input=workString.nextLine();
	int i, j;
	int  x1, y1, r;
	x1=0;
	y1=0;
	r=0;
	j = our_input.indexOf(" ");
	String a1="", a2="";
	for (i=0; i<=j-1; i++){
		a1 =a1+our_input.charAt(i);}
	for (i=j+1; i<=our_input.length()-1; i++){
		a2 = a2+our_input.charAt(i);
		x1 = Integer.parseInt(a1);
		y1 = Integer.parseInt(a2);
	}
	// coordinates are in, now reading the radius of a circle:
	System.out.println("please input the radius of the circle (integer)");
	our_input = workString.nextLine();
	   r = Integer.parseInt(our_input);
	// radius is in, now constructing a the circle:
	   System.out.println("we have x1=" + x1 + "  and y1=" + y1 +" and r=" + r);
	Circle c = new Circle(x1,y1,r);
	Circle c1;
	// moving the circle by dx,dy:
	int dx = 2; 
	int dy = -3;
	System.out.println("we are shifting the circle by dx="+dx+" and dy="+dy);
	c1=c.moveCircle(x1, y1, dx, dy);
	//constructing the square around initial circle:
	System.out.println("box around the initial circle:");
	Rect b=c.boundingBox();
	//constructing the square around the moved circle:
	System.out.println("box around the moved circle:");
	Rect b1 = c1.boundingBox();
	
	// checking for the point (px,py) to be inside the circles:
	boolean p_inside, p1_inside;
	int px,py;
	System.out.println("please, input positive coordinates (integers) of a point P: (format: (x y))");
	//reading coordinates:
	our_input=workString.nextLine();
	px=0;
	py=0;
	a1="";
	a2="";
	j = our_input.indexOf(" ");
	for (i=0; i<=j-1; i++){
		a1 =a1+our_input.charAt(i);}
	for (i=j+1; i<=our_input.length()-1; i++){
		a2 = a2+our_input.charAt(i);
		px = Integer.parseInt(a1);
		py = Integer.parseInt(a2);
	}
	// reading of coordinates of a point is done
	if (c.isInside(px, py)&&c1.isInside(px, py)) {System.out.println("the point is inside both unmoved and moved circles");}
	else if (c.isInside(px, py)) {System.out.println("the point is inside initial circle");}
	else if (c1.isInside(px, py)) {System.out.println("the point is inside moved circle");}
	else {System.out.println("we are not lucky - the point is outside our circles");}
	}
}
